package com.txzt.gaea.common.enums;

public enum UseStatus {

    /**
     * 使用中
     */
    USING(0,"使用中"),
    /**
     * 已归还
     */
    RETURNED(1,"已归还"),
    ;

    private final Integer code;

    private final String info;

    UseStatus(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfoByCode(Integer code){
        UseStatus[] statuses = values();
        for (UseStatus status:statuses){
            if (status.getCode().equals(code)) {
                return status.getInfo();
            }
        }
        return "";
    }
}
